<template>
	<view class="content">
		<view class="item">
			<view class="labTopName">
				<view class="viewName">
					<view class="labType labTypeActive" v-if="msgCategory == '2'">交易</view>
					<view class="labType" v-else>公告</view>
					<view class="labTitle">{{labTitle}}</view>
				</view>
				<view class="itemTime">{{labTime}}</view>
			</view>
			<view class="labContent">
				<rich-text :nodes="labContent"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
	
	import {readMsg} from '../../api/index.js'
	export default {
		data() {
			return {
				userId:'',
				msgId:'',
				labTitle:'',
				labTime:'',
				labContent:'',
				labName:'',
				msgCategory:''
				
			}
		},
		onLoad(options) {
			this.userId = getApp().globalData.userId
			if (options.id) {
				this.msgId = options.id
				this.getMyCouponList();
			}
		},
		methods: {
			async getMyCouponList() {
			
					let {result} = await readMsg({
						
						msgId:this.msgId,
						userId:this.userId,
					});
					this.labContent = result.body
					this.labTitle = result.titile
					this.labTime = result.publishTime
					this.msgCategory = result.msgCategory
					
			},
		}
	}
</script>

<style lang="less">
page{
	background-color: #F8F9FD;
}
.content{
	padding: 20rpx;
}

.item{
		padding:0 20rpx;
		border-radius: 6rpx;
		background-color: #fff;
		// position: relative;
		// margin-bottom: 20rpx;
		
		.labTopName{
			
			margin-top: 20rpx;
			padding: 20rpx 0;
			border-bottom: thin solid #F4F4F4;
			
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-weight: 400;
			
			.viewName{
				display: flex;
				align-items: center;
				.labType{
					height: 30rpx;
					padding: 0rpx 6rpx;
					background: #FAAC33;
					border-radius: 3rpx;
					
					color: #FFF;
					font-size: 22rpx;
					margin-right: 10rpx;
				}
				.labTypeActive{
					background: #FC6B88;
				}
				.labTitle{
					color: #333;
					font-size: 30rpx;
				}
				
			}
			.itemTime{
				
				font-size: 24rpx;
				color: #999999;
			}
			
		}
		.labContent{
			color: #666;
			font-size: 26rpx;
			padding: 40rpx 10rpx;
			
		}
	
		
		
	}

</style>
